<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../_third-party/bootstrap/bootstrap.css" />
		<link rel="stylesheet" type="text/css" href="../../_src/wm-custom.css" />
		<link rel="stylesheet" type="text/css" href="../../_src/pagination/pagination.css" />
	</head>
	<body>
		<div id="pagination1" class="wm-pagination"></div>
		<button type="button" class="btn btn-info" onclick="setPageSizeFun()">设置总页数</button>
		<button type="button" class="btn btn-primary" onclick="setPageTotalFun()">设置总条数</button>

		<script src="../../_third-party/jQuery/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../_third-party/bootstrap/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../_src/pagination/pagination.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function() {
				$('#pagination1').pagination({
					totalData: 0, // 总条数
					pageCount: 10, // 总页数
					jump: true, // 是否开启跳转到指定页数，值为boolean类型
					jumpBtn: '跳转', // 跳转按钮文本内容
					coping: true,
					callback: function(api) {
						// 页面跳转回调
						// do something
						console.log('当前页码：' + api.getCurrent());
					}
				}, function(api) {
					_temp = api;
				});
			});

			var pageSize = 20;
			var pageNo = 0;
			var _temp = null;

			function setPageSizeFun() {
				// 设置送页数
				_temp.setPageCount(pageSize);
			}

			function setPageTotalFun() {
				// 设置送页数
				_temp.setTotalData(100);
			}
		</script>
	</body>
</html>
